package lee.meiriyiti.day1116;

import java.util.Scanner;

class TestDemo1116_1 {//两个回文字符串进行拼接，能够得到多少种回文字符串
    //https://www.nowcoder.com/questionTerminal/9d1559511b3849deaa71b576fa7009dc
    public static void main(String[] args) {
        //利用String和StringBuffer
        //注意点：1、substring方法取不到最后一位，所以需要length+1.
        //2、reverse方法是StringBuffer类的，
        // StringBuffer定义的是一个字符数组,需要用toString转换为字符串
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.nextLine();
        String str2 = scanner.nextLine();
        int count = 0;
        for (int i = 0; i < str1.length()+1; i++) {
            String str = str1.substring(0, i) + str2 + str1.substring(i, str1.length());
            StringBuffer tmp = new StringBuffer(str);
            if (tmp.reverse().toString().equals(str)) {
                count++;
            }
        }
        System.out.println(count);
    }
}
